﻿using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using SomethingSpacialClassLib.Web;
using SomethingSpacial.ViewModel;
using SomethingSpacial.Model;
using System.ServiceModel.DomainServices.Client;

namespace SomethingSpacial
{
	public partial class controlVideoChat : UserControl
	{
		public controlVideoChat()
		{
			// Required to initialize variables
			InitializeComponent();
            this.Loaded += new RoutedEventHandler(controlVideoChat_Loaded);
		}

        void controlVideoChat_Loaded(object sender, RoutedEventArgs e)
        {
            ((EventFeedbackViewModel)this.DataContext).loadEventFeedback(1);
        }

     public    void SaveFeedback(string UserName, string FeedbackType, int EventID, string FeedbackContent)
        {
            EventFeedback EventFeedbackNew = new EventFeedback();


            AppServices.Web.User CurrentUser = SomethingSpacial.AppServices.WebContext.Current.User;
            EventFeedbackNew.EFB_FeedbackContent = FeedbackContent;
            EventFeedbackNew.EFB_FeedbackType = FeedbackType;
            EventFeedbackNew.EFB_EventID = EventID;
            EventFeedbackNew.EFB_UserID = UserName;
            EventFeedbackNew.EFB_DateTime = DateTime.Now;

            ((EventFeedbackViewModel)this.DataContext).AddEventFeedback(EventFeedbackNew);
            ((EventFeedbackViewModel)this.DataContext).loadEventFeedback(EventID);

        }


	}
}